package com.flot.yazb.model.anchor;

import com.flot.yazb.base.model.BModel;
import com.flot.yazb.base.client.RetrofitFactory;
import com.flot.yazb.aop.stub.RMCallback;
import com.flot.yazb.aop.stub.RMResponse;
import com.flot.yazb.retrofit.service.BService;

/**
 * Created by fengdongfei on 2017/9/1.
 */

public class AnchorModel extends BModel {



    public static void getAnchorList(final Transit<AnchorModel[]> incubator) {
        RetrofitFactory.getInstance()
                .create(BService.UserService.class)
                .geAnchorList()
                .enqueue(new RMCallback<RMResponse<AnchorModel[]>>(incubator.getContext()) {
                    @Override
                    protected void onSuccess(RMResponse<AnchorModel[]> result) {
                        incubator.onBorn(result.content, result.code(), result.message());
                    }

                    @Override
                    protected void onFail(String errorCode, String errorInfo) {
                        incubator.onBorn(null, errorCode, errorInfo);
                    }
                });
    }

    public static void getDetail(String id,final Transit<AnchorModel> incubator) {
        RetrofitFactory.getInstance()
                .create(BService.UserService.class)
                .getAnchDetail(id)
                .enqueue(new RMCallback<RMResponse<AnchorModel>>(incubator.getContext()) {
                    @Override
                    protected void onSuccess(RMResponse<AnchorModel> result) {
                        incubator.onBorn(result.content, result.code(), result.message());
                    }

                    @Override
                    protected void onFail(String errorCode, String errorInfo) {
                        incubator.onBorn(null, errorCode, errorInfo);
                    }
                });
    }



    public static void getComment(final Transit<AnchorModel[]> incubator) {
        RetrofitFactory.getInstance()
                .create(BService.UserService.class)
                .getComment()
                .enqueue(new RMCallback<RMResponse<AnchorModel[]>>(incubator.getContext()) {
                    @Override
                    protected void onSuccess(RMResponse<AnchorModel[]> result) {
                        incubator.onBorn(result.content, result.code(), result.message());
                    }

                    @Override
                    protected void onFail(String errorCode, String errorInfo) {
                        incubator.onBorn(null, errorCode, errorInfo);
                    }
                });
    }


    public static void getHeadImgs(final Transit<AnchorModel[]> incubator) {
        RetrofitFactory.getInstance()
                .create(BService.UserService.class)
                .getHeadList()
                .enqueue(new RMCallback<RMResponse<AnchorModel[]>>(incubator.getContext()) {
                    @Override
                    protected void onSuccess(RMResponse<AnchorModel[]> result) {
                        incubator.onBorn(result.content, result.code(), result.message());
                    }

                    @Override
                    protected void onFail(String errorCode, String errorInfo) {
                        incubator.onBorn(null, errorCode, errorInfo);
                    }
                });
    }

    public static void getUrl(final Transit<AnchorModel[]> incubator) {
        RetrofitFactory.getInstance()
                .create(BService.UserService.class)
                .getUrl()
                .enqueue(new RMCallback<RMResponse<AnchorModel[]>>(incubator.getContext()) {
                    @Override
                    protected void onSuccess(RMResponse<AnchorModel[]> result) {
                        incubator.onBorn(result.content, result.code(), result.message());
                    }

                    @Override
                    protected void onFail(String errorCode, String errorInfo) {
                        incubator.onBorn(null, errorCode, errorInfo);
                    }
                });
    }

    public static void getvipUrl(final Transit<AnchorModel[]> incubator) {
        RetrofitFactory.getInstance()
                .create(BService.UserService.class)
                .getvipUrl()
                .enqueue(new RMCallback<RMResponse<AnchorModel[]>>(incubator.getContext()) {
                    @Override
                    protected void onSuccess(RMResponse<AnchorModel[]> result) {
                        incubator.onBorn(result.content, result.code(), result.message());
                    }

                    @Override
                    protected void onFail(String errorCode, String errorInfo) {
                        incubator.onBorn(null, errorCode, errorInfo);
                    }
                });
    }

    public static void getPhone(final Transit<AnchorModel> incubator) {
        RetrofitFactory.getInstance()
                .create(BService.UserService.class)
                .getPhone()
                .enqueue(new RMCallback<RMResponse<AnchorModel>>(incubator.getContext()) {
                    @Override
                    protected void onSuccess(RMResponse<AnchorModel> result) {
                        incubator.onBorn(result.content, result.code(), result.message());
                    }

                    @Override
                    protected void onFail(String errorCode, String errorInfo) {
                        incubator.onBorn(null, errorCode, errorInfo);
                    }
                });
    }

    public String id;
    public String pic;
    public String name;
    public String url;
    public String hit;
    public String diqu;

    public String headpic;
    public String username;

    public String rank;
    public String content;

    public long time;

}
